// 封装轮播图的业务逻辑
import { ref, onMounted } from 'vue'
import { getBannerAPI } from '@/apis/home'

export function useBanner() {
  const bannerList = ref([])
  // 方法
  const getBannerList = async () => {
    const res = await getBannerAPI({
      distributionSite: '2'
    })
    bannerList.value = res.result
  }
  onMounted(() => getBannerList())

  return {
    bannerList
  }
}
